#include "head.h"
int makeWorker(workerdata_t *workerdataArr, int workerNum){
    // 创建若干个子进程，子进程的信息保存在workerdataArr中
    pid_t pid;
    for(int i = 0; i < workerNum; ++i){
        pid = fork();// 父进程fork返回非0，是子进程的pid
        if(pid == 0){
            // 让这个if永远走不完
            eventLoop();
        }
        // 父进程的逻辑
        workerdataArr[i].pid = pid;//存储子进程的pid
        workerdataArr[i].status = FREE;//子进程一启动是空闲的
        printf("worker %d, pid = %d\n",i, pid);
    }
    return 0;
}
int eventLoop(){
    while(1){
        sleep(1);
    }
    return 0;
}
